<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePaperLibrariesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('paper_libraries', function (Blueprint $table) {
            $table->increments('id')->comment('问卷调试卷表');
            $table->string('paper_title', 255)->nullable()->comment('试卷标题');
            $table->string('paper_remark', 255)->nullable()->comment('试卷备注');
            $table->integer('region_id')->nullable()->comment('所属地区ID（1.北洸村）')->default(0);
            $table->integer('admin_id')->nullable()->comment('添加人')->default(0);
            $table->integer('answer_user_num')->nullable()->comment('答题人总数')->default(0);
            $table->string('version_num', 64)->nullable()->comment('试卷版本号');
            $table->integer('parents_id')->nullable()->comment('父ID')->default(0);
            $table->tinyInteger('publish_state')->nullable()->comment('发布状态（发布后题目不可编辑）')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('paper_libraries');
    }
}
